Carlos Garnacho [Tue, 28 Jul 2020 22:03:48 +0000 (00:03 +0200)]
gdk: Conflate GDK devices
Make GdkEvents hold a single GdkDevice. This device is closer to
the logical device conceptually, although it must be sufficient for
device checks (i.e. GdkInputSource), which makes it similar to the
physical devices.
Make the logical devices have a more accurate GdkInputSource where
needed, and conflate the event devices altogether.
Carlos Garnacho [Tue, 28 Jul 2020 21:00:02 +0000 (23:00 +0200)]
gdk: Drop source_device argument from _gdk_display_device_grab_update()
It's just passed around and used nowhere.
Carlos Garnacho [Tue, 28 Jul 2020 17:38:24 +0000 (19:38 +0200)]
gdk: Make events hold an axis array matching GdkAxisUse
Instead of doing device-specific translations of array positions,
use GdkAxisUse as an array index right away.
Carlos Garnacho [Tue, 28 Jul 2020 14:21:47 +0000 (16:21 +0200)]
gdk: Make GdkDevice axis API internal
All outside interaction happens through gdk_event_get_axis(), no
device poking is necessary, nor axis to array index translations.
Carlos Garnacho [Tue, 28 Jul 2020 15:10:45 +0000 (17:10 +0200)]
gdk: Remove gdk_device_get_axes()
Besides the implicit x/y assumptions, devices don't have axes. Those
are actually provided by the GdkDeviceTool driving the device, and
different tools may have different axes.
It does not make sense to offer this API that can change beneath
someone's feet, we now have gdk_device_tool_get_axes() which is static
to the tool.
Carlos Garnacho [Tue, 28 Jul 2020 15:07:48 +0000 (17:07 +0200)]
inspector: Show tool axes, instead of device axes
We are moving away from the latter as they are inconsistent with
Wayland. Make the inspector introspect known tools and their info,
instead.
Carlos Garnacho [Tue, 28 Jul 2020 14:51:41 +0000 (16:51 +0200)]
gdk: Add gdk_seat_get_tools() API call
There's GdkSeat::tool-added and ::tool-removed, but there's no
API to query the known tools. Add this call.
Carlos Garnacho [Tue, 28 Jul 2020 14:31:54 +0000 (16:31 +0200)]
gdk: Add gdk_device_tool_get_axes()
Axes are actually a per-tool property, we just adapt devices to the
current tool.
Carlos Garnacho [Tue, 28 Jul 2020 14:00:02 +0000 (16:00 +0200)]
docs: Correct migration note
A mentioned API call is now internal.
Carlos Garnacho [Tue, 28 Jul 2020 13:50:15 +0000 (15:50 +0200)]
gdkdevice: Remove gdk_device_get_state()
This is not needed nor recommended anymore, all reasons to maybe
need this were all kept within gdk.
Carlos Garnacho [Tue, 28 Jul 2020 13:46:05 +0000 (15:46 +0200)]
gtkwindow: Move away from gdk_device_get_state()
Use gdk_device_get_modifier_state() poking the keyboard and keymap,
instead of this function.
Carlos Garnacho [Tue, 28 Jul 2020 13:44:09 +0000 (15:44 +0200)]
gtkpopover: Move away from gdk_device_get_state()
Use gdk_device_get_modifier_state() poking the keyboard and keymap,
instead of this function.
Carlos Garnacho [Tue, 28 Jul 2020 13:25:28 +0000 (15:25 +0200)]
gdk: Drop GDK_SOURCE_CURSOR
Looking at the xf86-input-wacom driver code, this is not even a thing
anymore. Drop this device type, in modern days there's
GDK_DEVICE_TOOL_TYPE_MOUSE for this.
Matthias Clasen [Mon, 27 Jul 2020 20:51:17 +0000 (20:51 +0000)]
Merge branch 'wip/chergert/fix-macos-time-conversion' into 'master'
macos: support ARM/PowerPC time conversion for DisplayLink times
See merge request GNOME/gtk!2301
Christian Hergert [Mon, 27 Jul 2020 19:49:57 +0000 (12:49 -0700)]
macos: support ARM/PowerPC time conversion for DisplayLink times
When converting DisplayLink frame presentation times, we need to take into
account the arch-specific types. This tracks changes in GNOME/GLib!1566 so
that precision is not lost.
Matthias Clasen [Mon, 27 Jul 2020 18:50:45 +0000 (18:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2300
Yuri Chornoivan [Mon, 27 Jul 2020 17:45:19 +0000 (17:45 +0000)]
Update Ukrainian translation
Matthias Clasen [Mon, 27 Jul 2020 17:21:59 +0000 (13:21 -0400)]
gtk-demo: Simplify colors demo
Make best use of our new constructors.
Matthias Clasen [Mon, 27 Jul 2020 16:39:43 +0000 (12:39 -0400)]
NEWS: Tweak the wording
Matthias Clasen [Mon, 27 Jul 2020 15:45:51 +0000 (15:45 +0000)]
Merge branch 'a11y-docs' into 'master'
a11y: Document roles of widgets
See merge request GNOME/gtk!2299
Matthias Clasen [Mon, 27 Jul 2020 15:10:58 +0000 (11:10 -0400)]
docs: Flesh out the role table in the a11y intro
Add cross-references for all the widgets currently
implementing non-default roles.
Matthias Clasen [Mon, 27 Jul 2020 14:46:52 +0000 (10:46 -0400)]
a11y: Document roles of widgets
Add a section to the long description for each
widget that is using a non-default accessible role.
Piotr Drąg [Mon, 27 Jul 2020 14:45:40 +0000 (16:45 +0200)]
Update POTFILES.in and POTFILES.skip
Matthias Clasen [Mon, 27 Jul 2020 14:27:07 +0000 (14:27 +0000)]
Merge branch 'ebassi/a11y-fixes' into 'master'
Ebassi/a11y fixes
Closes #2955
See merge request GNOME/gtk!2298
Emmanuele Bassi [Mon, 27 Jul 2020 12:58:11 +0000 (13:58 +0100)]
a11y: Test unset relations
We use "NULL" in C to mean "undefined", when it comes to relations that
deal with references or reference lists.
Emmanuele Bassi [Mon, 27 Jul 2020 12:53:05 +0000 (13:53 +0100)]
a11y: Allow unsetting the relations using NULL
Accessible values storing references and reference lists can be unset by
using NULL to mean "undefined"; since we cannot return the NULL value,
we need to intercept it when collecting a value, and replace it with an
undefined GtkAccessibleValue, which is also the value used as the
default for GtkAccessibleRelation values that store a reference or a
reference list.
Fixes: #2955
Emmanuele Bassi [Mon, 27 Jul 2020 12:50:01 +0000 (13:50 +0100)]
docs: Document a11y attributes
Matthias Clasen [Mon, 27 Jul 2020 12:36:54 +0000 (08:36 -0400)]
NEWS: Updates
Emmanuele Bassi [Mon, 27 Jul 2020 12:06:59 +0000 (12:06 +0000)]
Merge branch 'ebassi/ci-dags' into 'master'
ci: Use DAG attributes
See merge request GNOME/gtk!2297
Matthias Clasen [Mon, 27 Jul 2020 11:55:19 +0000 (11:55 +0000)]
Merge branch 'ebassi/new-a11y' into 'master'
Accessibility rework
See merge request GNOME/gtk!2239
Emmanuele Bassi [Mon, 27 Jul 2020 11:44:36 +0000 (12:44 +0100)]
ci: Use DAG attributes
Some jobs can run out of order, as they are entirely self-contained. If
we use the newly added DAG attributes, we can speed up the CI pipeline.
Emmanuele Bassi [Mon, 27 Jul 2020 10:46:52 +0000 (11:46 +0100)]
a11y: Make GtkATContext.create() public
Implementations of the GtkAccessible interface should have a way to
instantiate the appropriate GtkATContext.
Emmanuele Bassi [Mon, 27 Jul 2020 10:46:07 +0000 (11:46 +0100)]
docs: Add missing GTK_ACCESSIBLE_VALUE_UNDEFINED
Matthias Clasen [Mon, 27 Jul 2020 05:21:05 +0000 (01:21 -0400)]
a11y: Add some more tests
Test that setting multiple states or properties
at the same time works as expected.
Matthias Clasen [Mon, 27 Jul 2020 04:22:15 +0000 (00:22 -0400)]
Add some more a11y tests
Add some tests that exercise the accessible machinery
without any connection to widgets.
Matthias Clasen [Mon, 27 Jul 2020 04:21:01 +0000 (00:21 -0400)]
a11y: Be a bit safer against crashes
We are collecting values from varargs and use them
as indices into static arrays. We should at least
do some bounds checking to prevent silly crashes.
Matthias Clasen [Mon, 27 Jul 2020 02:39:17 +0000 (22:39 -0400)]
docs: Expand GtkAccessible documentation
Add some hints and examples.
Matthias Clasen [Mon, 27 Jul 2020 02:13:41 +0000 (22:13 -0400)]
docs: Add documentation for accessible enumerations
This is largely taking text from the aria spec.
Matthias Clasen [Mon, 27 Jul 2020 01:18:50 +0000 (21:18 -0400)]
docs: Update GtkAccessibleRole docs
Sync up the docs with changed enum values, and document
all the roles that are used in GTK at the moment. All
others are left as "Unused".
Matthias Clasen [Mon, 27 Jul 2020 00:54:57 +0000 (20:54 -0400)]
docs: Fix up some issues in the a11y docs
Fix up syntax errors and links in the introductory
section about accessibility.
Matthias Clasen [Mon, 27 Jul 2020 00:30:36 +0000 (20:30 -0400)]
docs: Update a11y docs
Add some missing functions.
Matthias Clasen [Sun, 26 Jul 2020 23:57:48 +0000 (23:57 +0000)]
Merge branch 'drop-down-constructor' into 'master'
GtkDropDown api revisions
See merge request GNOME/gtk!2286
Matthias Clasen [Sun, 26 Jul 2020 23:56:21 +0000 (23:56 +0000)]
Merge branch 'list-constructors' into 'master'
List constructors
See merge request GNOME/gtk!2296
Matthias Clasen [Sun, 26 Jul 2020 22:50:50 +0000 (18:50 -0400)]
gridview: Revise constructors
Make both gtk_grid_view_new and gtk_grid_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 22:32:50 +0000 (18:32 -0400)]
columnview: Revise the constructor
Make gtk_column_view_new take a model as first argument,
and make it allow-none and transfer full.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 22:27:23 +0000 (18:27 -0400)]
listview: Revise constructors
Make both gtk_list_view_new and gtk_list_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 13:34:08 +0000 (09:34 -0400)]
dropdown: Revise constructors
A dropdown without a model is useless, so accept a model
and expression in the constructor. Allow them to be NULL,
but consume them if given. This makes chained constructors
convenient without breaking language bindings.
Drop gtk_drop_down_set_from_strings() and instead add
gtk_drop_down_new_from_strings().
Update all users.
Matthias Clasen [Sun, 26 Jul 2020 21:34:44 +0000 (17:34 -0400)]
selectionfiltermodel: Make constructor allow-none
We don't pay attention to item-type anymore, so
drop the item-type property and the _for_item_type()
constructor, and allow passing NULL to the regular
constructor.
We don't make this constructor transfer-full, since
the selection filter model is not a wrapping model
like the others. It is more like fork than a wrap.
Matthias Clasen [Sun, 26 Jul 2020 21:25:06 +0000 (17:25 -0400)]
multiselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Also make the constructor return GtkMultiSelection *.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 21:16:15 +0000 (17:16 -0400)]
singleselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 20:55:43 +0000 (16:55 -0400)]
noselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 20:38:53 +0000 (16:38 -0400)]
treelistmodel: Make constructor transfer full
Make gtk_tree_list_model_new() take the root model
as first argument, and make it transfer full, for
consistency with other wrapping list constructors.
Update all callers.
Still missing here: Make the model property writable,
and allow passing NULL in the constructor.
Matthias Clasen [Sun, 26 Jul 2020 20:25:12 +0000 (16:25 -0400)]
sortlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 19:55:44 +0000 (15:55 -0400)]
filterlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 19:38:15 +0000 (15:38 -0400)]
slicelistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 18:37:55 +0000 (14:37 -0400)]
listlistmodel: Drop item_type
We are using G_TYPE_OBJECT throughout, so there
is no need for GtkListListModel to do anything else.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 18:20:25 +0000 (14:20 -0400)]
maplistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Matthias Clasen [Sun, 26 Jul 2020 14:53:55 +0000 (10:53 -0400)]
flattenlistmodel: Make the constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.
Update all callers.
Emmanuele Bassi [Sun, 26 Jul 2020 19:56:54 +0000 (20:56 +0100)]
ci: Re-enable the accessibility test suite
Now that we have something that is both reliable and local.
Emmanuele Bassi [Sun, 26 Jul 2020 19:30:35 +0000 (20:30 +0100)]
a11y: Add a simple test case for GtkButton's accessible state
Emmanuele Bassi [Sun, 26 Jul 2020 19:29:00 +0000 (20:29 +0100)]
a11y: Simplify the test API
We don't need as many functions to print out the property, relation, and
state of an accessible. Additionally, we should allow comparing the
accessible attributes with an expected value, and print out the real
accessible value if they do not match.
Emmanuele Bassi [Sun, 26 Jul 2020 19:27:39 +0000 (20:27 +0100)]
a11y: Allow setting the role post-construction
Some widgets have different roles after they are constructed, so we need
to allow changing the role defined by the class. We should still avoid
setting a role after the GtkATContext has been created.
Emmanuele Bassi [Sun, 26 Jul 2020 14:50:55 +0000 (15:50 +0100)]
a11y: Add API to retrieve accessible values
We are going to use this for implementing ATContext subclasses, but also
in the testing API.
Emmanuele Bassi [Wed, 22 Jul 2020 15:32:09 +0000 (16:32 +0100)]
a11y: Add more test API
Emmanuele Bassi [Wed, 22 Jul 2020 15:31:44 +0000 (16:31 +0100)]
a11y: Restart the accessibility test suite
Emmanuele Bassi [Wed, 22 Jul 2020 12:48:00 +0000 (13:48 +0100)]
Fix build with debugging notes disabled
Matthias Clasen [Fri, 17 Jul 2020 19:51:28 +0000 (15:51 -0400)]
a11y: Update GtkCheckButton
This is a bit unfortunate, since the aria modelling
doesn't quite agree with ours, so we have to listen
for the togglebutton property change, and we inherit
the pressed state from the togglebutton accessible.
Matthias Clasen [Fri, 17 Jul 2020 18:41:06 +0000 (14:41 -0400)]
a11y: Update GtkSpinButton
Set the appropriate accessible role, and update
the value properties.
Matthias Clasen [Fri, 17 Jul 2020 17:10:18 +0000 (13:10 -0400)]
a11y: Update GtkProgressBar
Update state and properties as appropriate.
Matthias Clasen [Fri, 17 Jul 2020 16:42:24 +0000 (12:42 -0400)]
testatcontext: Print role nicks
This makes for easier reading.
Emmanuele Bassi [Wed, 22 Jul 2020 12:11:28 +0000 (13:11 +0100)]
a11y: Update labelled-by when setting mnemonic labels
The ARIA labelled-by attribute behaves the same way as the mnemonic
labels in GTK.
Emmanuele Bassi [Wed, 22 Jul 2020 12:08:20 +0000 (13:08 +0100)]
a11y: Change the collection type for reflist attributes
Emmanuele Bassi [Wed, 22 Jul 2020 12:07:36 +0000 (13:07 +0100)]
a11y: Allow storing list of references in GtkAccessibleValue
It's one of the fundamental accessible value types in ARIA.
Emmanuele Bassi [Fri, 17 Jul 2020 16:43:01 +0000 (17:43 +0100)]
a11y: Change default accessible role
Only GtkWidget should use GTK_ACCESSIBLE_ROLE_WIDGET as its default
accessible role; the default for GtkAccessible and GtkATContext should
be GTK_ACCESSIBLE_ROLE_NONE, meaning "an element whose implicit native
role semantics will not be mapped to the accessibility API", according
to the WAI-ARIA specification.
Matthias Clasen [Fri, 17 Jul 2020 14:40:31 +0000 (10:40 -0400)]
inspector: Support the a11y debug flag
Add support for the GTK_DEBUG_A11Y debug flag in
the logs tab.
Matthias Clasen [Fri, 17 Jul 2020 14:36:43 +0000 (10:36 -0400)]
testatcontext: Use the new debug flag
Only dump a11y state if GTK_DEBUG=accessibility is set.
Matthias Clasen [Fri, 17 Jul 2020 14:36:20 +0000 (10:36 -0400)]
Add GTK_DEBUG=accessibility
Add a debug flag for accessibility-related debug spew.
Emmanuele Bassi [Fri, 17 Jul 2020 13:39:56 +0000 (14:39 +0100)]
a11y: Add testing API
We want to test the accessibility API, as well as the implementation
inside each widget. For that, we should expose an API that lets us
verify that a GtkAccessible has a given role, as well as a given
property.
The API follows the pattern of other GTest API:
- a macro to assert that a condition is respected
- a function that prints out the error message in case of failure
Emmanuele Bassi [Fri, 17 Jul 2020 13:31:02 +0000 (14:31 +0100)]
a11y: Implement role and state change in GtkSwitch
Set the "switch" role, and update the "checked" state when the :active
property is toggled.
Emmanuele Bassi [Fri, 17 Jul 2020 11:49:59 +0000 (12:49 +0100)]
a11y: Consolidate the attributes container
While we have split the various attributes for convenience, there's no
reason why we should have specialised data types for the attributes
container object.
Emmanuele Bassi [Fri, 17 Jul 2020 11:00:31 +0000 (12:00 +0100)]
a11y: Add relations API
Since we split relation attributes from the generic properties, we need
to add API for setting and retrieving their values.
Emmanuele Bassi [Thu, 16 Jul 2020 17:08:22 +0000 (18:08 +0100)]
a11y: Simplify GtkAccessibleValue
Reduce the amount of subclassing, by handling collection of fundamental
types directly from the generic code paths. We now handle boolean,
tristate, integer, number, string, and relation values in the generic
code path; if an attribute supports the "undefined" value, we return the
undefined value singleton.
Emmanuele Bassi [Wed, 15 Jul 2020 18:08:37 +0000 (19:08 +0100)]
a11y: Resync with the ARIA spec
Drop roles and properties that were deprecated in WAI-ARIA 1.1, and add
new roles and properties defined in WAI-ARIA 1.2 and later.
We also split the relationship properties into their own enumeration, so
we can keep the GtkAccessibleProperty type more compact.
Emmanuele Bassi [Wed, 15 Jul 2020 12:20:38 +0000 (13:20 +0100)]
Remove GTK_ACCESSIBLE_STATE_NONE
It's pointless, we can use an explicit value of `-1` everywhere.
Additionally, it complicates all code that uses the state enumeration as
an array index, since now we need to guard against a negative offset.
Emmanuele Bassi [Mon, 13 Jul 2020 16:47:36 +0000 (17:47 +0100)]
a11y: Add binding-friendly accessible property setter
Matching the one for the accessible state.
Emmanuele Bassi [Mon, 13 Jul 2020 16:43:06 +0000 (17:43 +0100)]
a11y: Collect reference value
Some properties that take a reference to an accessible haven't been
updated to collect the correct type.
Emmanuele Bassi [Mon, 13 Jul 2020 16:04:38 +0000 (17:04 +0100)]
a11y: Update the accessible label for GtkButton
Emmanuele Bassi [Mon, 13 Jul 2020 15:26:24 +0000 (16:26 +0100)]
a11y: Update GtkSeparator
Add an accessible role, and update the orientation state.
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:44 +0000 (16:22 +0100)]
a11y: Set the role for GtkScale
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:22 +0000 (16:22 +0100)]
a11y: Update the accessible state for GtkRange
Emmanuele Bassi [Mon, 13 Jul 2020 15:10:36 +0000 (16:10 +0100)]
a11y: Update the "pressed" state on toggle buttons
Emmanuele Bassi [Mon, 13 Jul 2020 15:03:27 +0000 (16:03 +0100)]
a11y: Add roles to various widgets
Emmanuele Bassi [Mon, 13 Jul 2020 14:51:39 +0000 (15:51 +0100)]
Add accessible properties to GtkAccessible
We propagate the accessible state and properties to each ATContext in
the same virtual function, since they are functionally similar.
Emmanuele Bassi [Sun, 12 Jul 2020 19:07:57 +0000 (20:07 +0100)]
Add GtkAccessiblePropertySet
Like GtkAccessibleStateSet, the PropertySet is a set for accessible
properties.
Emmanuele Bassi [Mon, 13 Jul 2020 14:22:24 +0000 (15:22 +0100)]
Plumb all the GtkAccessibleProperty values into GtkAccessibleValue
Similarly to how we deal with GtkAccessibleState.
Emmanuele Bassi [Mon, 13 Jul 2020 14:20:19 +0000 (15:20 +0100)]
Allow setting the accessible role at construction
Some widgets have different accessible roles depending on some
parameter, so we cannot set the role at class init time. For those
widgets, we add an "accessible-role" property to GtkAccessible, and we
allow setting it (only) at construction time.
Emmanuele Bassi [Wed, 8 Jul 2020 13:42:32 +0000 (14:42 +0100)]
Start documenting the Accessibility API
Add the introductory text from #2833, and the various types to the API
reference.
Emmanuele Bassi [Tue, 7 Jul 2020 16:51:01 +0000 (17:51 +0100)]
Update the accessible state on widget visibility changes
The GTK_ACCESSIBLE_STATE_HIDDEN has the opposite meaning of the
GtkWidget:visible property.
Emmanuele Bassi [Wed, 8 Jul 2020 15:58:11 +0000 (16:58 +0100)]
Have GtkWidget implement GtkAccessible
Each widget type has an accessible role associated to its class, as
roles cannot change during the life time of a widget instance.
Each widget is also responsible for creating an ATContext, to proxy
state changes to the underlying accessibility infrastructure.
Emmanuele Bassi [Wed, 8 Jul 2020 15:56:31 +0000 (16:56 +0100)]
Plug GtkATContext into GtkAccessible
An Accessible implementation must create an ATContext object. UI
elements are supposed to interact with the GtkAccessible API, but we
expose GtkATContext to allow patterns like delegation.